package ReflectionPractice.Practice3CallMethod;

public class Main {
    public static void main(String[] args) throws NoSuchMethodException {
        Class stdClz = Student.class;
        // 获取public方法getScore，参数为String
        System.out.println(stdClz.getMethod("getScore", String.class));
        // 获取继承的public方法getName，无参数
        System.out.println(stdClz.getMethod("getName"));
        // 获取private方法getGrade，参数为int
        System.out.println(stdClz.getDeclaredMethod("getGrade", int.class));
    }
}
